﻿<!DOCTYPE HTML>
<html>

<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
    
    <link href="static/h-ui/css/H-ui.min.css" rel="stylesheet" />
    <link href="static/h-ui.admin/css/H-ui.login.css" rel="stylesheet" />
    <link href="static/h-ui.admin/css/style.css" rel="stylesheet" />
    <link href="lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>欢迎登录二手房评估平台</title>
<!--<meta name="keywords" content="H-ui.admin v3.0,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description" content="H-ui.admin v3.0，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">-->
</head>
<body>
    
<input type="hidden" id="TenantId" name="TenantId" value="" />
   
<div class="loginWraper">
  <div id="loginform" class="loginBox">
    <form class="form form-horizontal" action="index.html" method="get">
      <div class="row cl">
        <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
        <div class="formControls col-xs-8">
          <input id="name" name="" type="text" placeholder="账户" onblur="zh()" class="input-text size-L">
          <br />  <span id="s1" style="color:#ff0000"></span>
        </div>
      </div>
      <div class="row cl">
        <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
        <div class="formControls col-xs-8">
          <input id="pwd" name="" type="password" placeholder="密码" onblur="mm()" class="input-text size-L">
            <br /> <span id="s2" style="color:#ff0000"></span>
        </div>
      </div>
      <div class="row cl">
        <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe622;</i></label>
        <div class="formControls col-xs-8 ">
          <input id="yz" class="input-text size-L" type="text" placeholder="验证码" onblur="yzm()" style="width:150px;">
            <!--<img alt="" src="/ValidateCode.ashx" onclick="this.src = 'ValidateCode.ashx?d='+new Date()" />-->
            <img alt="" id="yzm" src="/ValidateCode.ashx?a=" onclick="this.src+=1" style="height:40px; width:100px;" />
            <span id="s3" style="color:#ff0000"></span>
      </div>
      <div class="row cl">
        <div class="formControls col-xs-8 col-xs-offset-3">
          <label for="online">
            <input type="checkbox" name="online" id="online" >
            使我保持登录状态</label>
        </div>
      </div>
      <div class="row cl">
        <div class="formControls col-xs-8 col-xs-offset-3">
          <input name="" id="login" type="button" onclick="Login()" class="btn btn-success radius size-L" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
          <input name="" type="reset" class="btn btn-default radius size-L" value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;">
        </div>
      </div>
    </form>
  </div>
</div>
<div class="footer">Copyright 你的公司名称 by H-ui.admin v3.0</div>
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
    <script src="lib/layer/2.4/layer.js"></script>
    <script src="lib/jquery-1.8.2.min.js"></script>
    <script src="lib/JSCookie.js"></script>
    <script>
        
        
        
        //光标离开账户事件
        function zh()
        {
            var name = $("#name").val();
            if (name == "" || name == null)
            {
                s1.innerHTML="账号不能为空";
                return;
            }
            else
            {   
                s1.innerHTML="";
            }
        }
        //离开密码事件
        function mm() {
            var pwd = $("#pwd").val();
            if (pwd == "" || pwd == null) {
                s2.innerHTML="密码不能为空";
                return;
            }
            else {
                s2.innerHTML="";
            }
        }
        //离开验证码事件
        function yz() {
            var yz = $("#yz").val();
            if (yz == "" || yz == null) {
                s3.innerHTML="验证码不能为空";
                return;
            }
            else {
                s3.innerHTML="";
            }
        }
        //用户登录事件
        function Login()
        {
      
            var name = $("#name").val();
            var pwd = $("#pwd").val();
            var yz = $("#yz").val();
            if (name == "" || pwd == "" || yz== "") {
                alert("信息不完整");
                return;
            }
            else
            {
                $.ajax({
                    url: "Handler1.ashx",
                    type: "Get",
                    data: { yzm: yz },
                    success: function (i)
                    {
                        if (i == 1)
                        {
                            $.ajax({
                                url: "http://localhost:41607/api/Entrance/GetStaffLogin",
                                type: "Get",
                                data: {
                                    name: name,
                                    pwd: pwd
                                },
                                success: function (r) {



                                    if (r.LoginState == 0) {
                                        layer.msg('该账号不存在!', { icon: 2, time: 2000 });

                                    }
                                    else if (r.LoginState == 1) {
                                        layer.msg('密码错误!', { icon: 2, time: 2000 });

                                    }
                                    else if (r.LoginState == 2) {
                                        sessionStorage.setItem("Login", r.LoginKeyId);
                                        location.href = "Index.html";
                                    }
                                }
                            })
                        }
                        else
                        {
                            layer.msg('验证码错误!', { icon: 2, time: 2000 });
                            $("#yzm").click();
                        }
                    }
                })
            }
        }

        //$(function () {
        //    $("#login").click(function () {
        //        location.href = "Index.html";
        //    })
        //})
    </script>

</body>
</html>